home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / piano.zip / SAVENOTE.BAK < prev    next >
Text File  |  1992-07-23  |  710b  |  40 lines

  1.  
  2. #include <conio.h>        // for getch()
  3. #include <dos.h>        // for delay()
  4. #include <fstream.h>        // for cout, etc
  5.  
  6.  
  7. class Note
  8.     {
  9.     public:
  10.         char letter ;
  11.         float delay ;
  12.         void getnote()
  13.             {
  14.             cout << "\nEnter letter: " ; cin >> letter ;
  15.             cout << "\nEnter delay: " ; cin >> delay ;
  16.             }
  17.         void shownote()
  18.             {
  19.             cout << "\nLetter : " << letter ;
  20.             cout << "\nDelay  : " << delay ;
  21.             }
  22.     };
  23.  
  24.  
  25. void main()
  26.     {
  27.     char ch ;
  28.     Note note ;
  29.     fstream file ;
  30.     file.open( "A:SONG1.DAT" , ios::app | ios::out | ios::in ) ;
  31.     do
  32.         {
  33.         note.getnote() ;
  34.         file.write( (char*)¬e, sizeof( note ) ) ;
  35.         cout << "\nEnter another note (y/n)? " ;
  36.         cin >> ch ;
  37.         }
  38.     while ( ch == 'y' ) ;
  39.     }
  40.